﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IBLL;
using BLLFactory;

namespace Face.Web.login_and_signup
{
    public partial class login2 : System.Web.UI.Page
    {
        UserinfoIBLL userinfoIBLL = BLLFactory.DataAccess.getUserinfoIBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void loginButton_Click(object sender, EventArgs e)
        {
            string nusername = username.Text;
            string npassword = password.Text;
            if (userinfoIBLL.login(nusername, npassword))
            {
                Session["user"] = nusername;
                Response.Redirect("/Pic_and_article/picture.aspx");
            }
            else
            {
                Response.Write("用户名密码出错!");
            }
        }

        protected void registerButton_Click(object sender, EventArgs e)
        {
            Response.Redirect("/login_and_signup/signup.aspx");
        }
    }
}